Skip to content

fix(binary-codec): align confidential MPT wire fields - #346

Draft
kpitapeersyst wants to merge 3 commits into
confidential-transfersfrom
binary-codec/fix/confidential-mpt-wire-fields
Draft

fix(binary-codec): align confidential MPT wire fields#346
kpitapeersyst wants to merge 3 commits into
confidential-transfersfrom
binary-codec/fix/confidential-mpt-wire-fields

Conversation

@kpitapeersyst

@kpitapeersyst kpitapeersyst commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

fix(binary-codec): align confidential MPT wire fields

Description

This PR aligns confidential MPT field definitions and serialization with the canonical XRPL wire format. It corrects commitment and blinding-factor metadata while preserving hexadecimal UInt64 behavior for ordinary fields and using base-ten encoding only where explicitly declared by the field definitions.

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Refactoring

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code where needed
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective
  • New and existing unit tests pass locally with my changes

Changes

  • Define BlindingFactor as a non-variable-length Hash256 field with the canonical ordinal.
  • Correct the canonical ordinals for AmountCommitment and BalanceCommitment.
  • Mark MPT amount-related UInt64 fields as base-ten in the field definitions.
  • Apply base-ten UInt64 conversion only when the field metadata requires it.
  • Preserve strict hexadecimal serialization for ordinary UInt64 fields.
  • Add golden wire fixtures and round-trip coverage for live RPC numeric representations.

Tests

  • CGO_ENABLED=1 CC=gcc go test ./binary-codec/... ./pkg/typecheck

CI status

Note

The current Lint and Test and Run govulncheck failures are expected until #345 is merged into confidential-transfers. The target branch already contains the updated mpt-crypto header, but it does not yet contain the matching CGo decryption call added by #345. This PR does not modify confidential/mptcrypto.

After #345 is merged, this branch will be rebased onto the updated target branch and the checks will run again.

Notes

  • This PR targets the temporary confidential-transfers integration branch.
  • Changelog updates are intentionally deferred until the integration branch stabilizes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant